package com.itboye.mengwu.data.repository;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gson.reflect.TypeToken;
import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.core.utils.BaseErrorListener;
import com.itboye.core.utils.BaseSuccessReqListener;
import com.itboye.core.utils.ByJsonRequest.Builder;
import com.itboye.mengwu.data.interfaces.IWoMengAddGoods;
import com.itboye.mengwu.data.model.GoodsListModel;
import com.itboye.mengwu.data.model.WoMengGoodsListModel;

public class WoMengCollectionRepository extends BaseNetRepository implements IWoMengAddGoods<WoMengGoodsListModel>{

	String api = "100";
	public static final String WoMengCollectionGoodsQuery="BY_Product_getFavorites";// 5.5 收藏商品分页（分页查询）
	
	public WoMengCollectionRepository(ICompleteListener listener) {
		// TODO Auto-generated constructor stub
		super(listener);
	}
	@Override
	public void add(WoMengGoodsListModel model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void delete(WoMengGoodsListModel model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update(WoMengGoodsListModel model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void getInfo(WoMengGoodsListModel model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public List<WoMengGoodsListModel> queryYouHuiQuan(WoMengGoodsListModel model) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void queryWoMengCollectionGoods(String uid, String pageNo, String pageSize) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<WoMengGoodsListModel>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> map = new HashMap<String, Object>();
		 map.put("uid", uid);
		 map.put("page_no", pageNo);
		 map.put("page_size", pageSize);
		(new Builder<WoMengGoodsListModel>())
				.setTypeVerParamsAndReturnClass(WoMengCollectionGoodsQuery, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<WoMengGoodsListModel>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

}
